package org.csu.wuliu.domain;

import java.io.Serializable;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;



public class Order implements Serializable {
    private String orderId;
    private String username;
    private Date orderDate;
    private int status;
    private String state;

    public String getState() {
       return state;
    }

    public void setState(String state) {
        this.state = state;
    }
//    private BigDecimal totalPrice;
//    private List<LineItem> lineItems = new ArrayList<LineItem>();

    public Order() {
        orderDate = new Date();
    }

    public Order(String orderId, String username, Date orderDate, int status) {
        this.orderId = orderId;
        this.username = username;
        this.orderDate = orderDate;
        this.status = status;
    }

    public String getOrderId() {
        return orderId;
    }

    public void setOrderId(String orderId) {
        this.orderId = orderId;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public Date getOrderDate() {
        return orderDate;
    }

    public void setOrderDate(Date orderDate) {
        this.orderDate = orderDate;
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
        switch (status){
            case 0: state =  "缺货";break;
            case 1: state =  "进货中";break;
            case 2: state ="有货";break;
            case 3: state = "已从总站发出";break;
            case 4: state = "到达分站";break;
            case 5: state ="配送中";break;
            case 6: state = "用户已签收";break;
            case 7: state = "用户在缺货时退货";break;
            case 8: state = "用户在进货中时退货";break;
            case 9: state = "用户在有货时退货";break;
            case 10:state = "用户在已从总站发出时退货";break;
            case 11:state = "用户在到达分站时退货";break;
            case 12:state = "用户在配送中退货";break;
            case 13:state = "用户已签收后退货";break;
            default:  state = "异常状态";break;
        }
    }

//    public BigDecimal getTotalPrice() {
//        return totalPrice;
//    }
//
//    public void setTotalPrice(BigDecimal totalPrice) {
//        this.totalPrice = totalPrice;
//    }
//
//    public List<LineItem> getLineItems() {
//        return lineItems;
//    }
//
//    public void setLineItems(List<LineItem> lineItems) {
//        this.lineItems = lineItems;
//    }
}
